﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;

namespace websoniBO
{
    public class Like_poems
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _lpid = -99;
        private long _pid = -99;
        private long _likecount = -99;
        private bool _isdeleted = false;
        public long lpid
        {
            get
            {
                return _lpid;
            }
            set
            {
                _lpid = value;
            }
        }
        public long pid
        {
            get
            {
                return _pid;
            }
            set
            {
                _pid = value;
            }
        }
        public long likecount
        {
            get
            {
                return _likecount;
            }
            set
            {
                _likecount = value;
            }
        }
        public bool isdeleted
        {
            get
            {
                return _isdeleted;
            }
            set
            {
                _isdeleted = value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@lpid", lpid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@pid", pid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@likecount", likecount, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3 };
                return DAC.Save("like_poems_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(long lpid, long pid, long likecount, bool isdeleted, string paraandor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@lpid", lpid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@pid", pid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@likecount", likecount, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@paraandor", paraandor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4 };
                DataTable dt1 = DAC.Select("like_poems_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }
    }
}
